#include "RaceInfo.h"

RaceInfo::RaceInfo() {
	this->numberOfCards = 0;
	this->extension = false;
	this->extensionAllowed = false;
	this->normalDistance = 1000;
	this->extensionDistance = 1000;
}

RaceInfo::RaceInfo(int numberOfCard, bool extension, bool extensionAllowed, int normalDistance, int extensionDistance) {
	this->numberOfCards = numberOfCard;
	this->extension = extension;
	this->extensionAllowed = extensionAllowed;
	this->normalDistance = normalDistance;
	this->extensionDistance = extensionDistance;
}



QDataStream &operator<<(QDataStream& out, const RaceInfo& raceInfo) {
	out << raceInfo.numberOfCards;
	out << raceInfo.extension;
	out << raceInfo.extensionAllowed;
	out << raceInfo.normalDistance;
	out << raceInfo.extensionDistance;
	
	return out;
}

QDataStream &operator>>(QDataStream& in, RaceInfo& raceInfo) {
	in >> raceInfo.numberOfCards;
	in >> raceInfo.extension;
	in >> raceInfo.extensionAllowed;
	in >> raceInfo.normalDistance;
	in >> raceInfo.extensionDistance;
	
	return in;
}


QDebug operator<<(QDebug dbg, const RaceInfo &raceInfo) {
	
	dbg.nospace() << raceInfo.numberOfCards << " / " << raceInfo.extension << " " << raceInfo.extensionAllowed << " / " << raceInfo.normalDistance << " " << raceInfo.extensionDistance;
	
	return dbg.space();
}
